Skip to content

fix: Don't change github regex if override is active#132

Merged
dkorecko merged 2 commits intomainfrom
fix/overriding-github-regex
Mar 27, 2026
Merged

fix: Don't change github regex if override is active#132
dkorecko merged 2 commits intomainfrom
fix/overriding-github-regex

Conversation

@dkorecko
Copy link
Copy Markdown
Owner

@dkorecko dkorecko commented Mar 27, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where container configuration settings were being unconditionally overwritten during reset operations. Version settings now respect existing override preferences, preventing inadvertent loss of configured values.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

Warning

Rate limit exceeded

@dkorecko has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 2 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 15 minutes and 2 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2a76fb96-5e81-45e0-a4c0-d25ebc8900fc

📥 Commits

Reviewing files that changed from the base of the PR and between 9a5dc7e and 0b46040.

📒 Files selected for processing (1)
  • PatchPanda.Web/Services/DockerService.cs
📝 Walkthrough

Walkthrough

Modified DockerService.ResetComposeStacks() to conditionally update existingContainer.GitHubVersionRegex only when existingContainer.OverrideGitHubRepo is null. Previously this field was unconditionally overwritten during container synchronization.

Changes

Cohort / File(s) Summary
Container Sync Conditional Logic
PatchPanda.Web/Services/DockerService.cs
Added condition to prevent GitHubVersionRegex from being overwritten when OverrideGitHubRepo is already set during compose stack reset operations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit's delight in conditions so neat,
GitHubVersionRegex won't skip a beat!
When Override is null, the update takes flight,
Synchronized containers done just right! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: conditionally skipping GitHubVersionRegex updates when an override is active in the DockerService.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/overriding-github-regex

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@PatchPanda.Web/Services/DockerService.cs`:
- Around line 290-291: The current guard around
existingContainer.OverrideGitHubRepo prevents copying
runningContainer.GitHubVersionRegex when a container is overridden, leaving
GitHubVersionRegex null and breaking VersionService and UpdateService flows;
modify the logic in DockerService.cs (around
existingContainer.OverrideGitHubRepo and GitHubVersionRegex handling) so that
you still do not overwrite when OverrideGitHubRepo is set, but if
existingContainer.GitHubVersionRegex is null then backfill it from
runningContainer.GitHubVersionRegex (i.e., only assign GitHubVersionRegex when
the target property is null), ensuring UpdateService and VersionService receive
a non-null regex while preserving override semantics.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6fef1fca-db81-4276-9352-442de1a61770

📥 Commits

Reviewing files that changed from the base of the PR and between d67ce84 and 9a5dc7e.

📒 Files selected for processing (1)
  • PatchPanda.Web/Services/DockerService.cs

Comment on lines +290 to +291
if (existingContainer.OverrideGitHubRepo is null)
existingContainer.GitHubVersionRegex = runningContainer.GitHubVersionRegex;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Preserve override behavior, but backfill missing GitHubVersionRegex to prevent update-flow failures.

On Line 290, the new guard can leave overridden containers with GitHubVersionRegex == null forever. That causes empty version results in PatchPanda.Web/Services/VersionService.cs (Line 98), suppresses updates in PatchPanda.Web/Services/UpdateService.cs (Line 78), and can throw in update execution (Line 341). Keep the non-overwrite intent, but backfill when missing.

Proposed fix
-                    if (existingContainer.OverrideGitHubRepo is null)
-                        existingContainer.GitHubVersionRegex = runningContainer.GitHubVersionRegex;
+                    if (existingContainer.OverrideGitHubRepo is null)
+                    {
+                        existingContainer.GitHubVersionRegex = runningContainer.GitHubVersionRegex;
+                    }
+                    else if (existingContainer.GitHubVersionRegex is null)
+                    {
+                        // Preserve user override semantics, but avoid null regex in update paths.
+                        existingContainer.GitHubVersionRegex = runningContainer.GitHubVersionRegex;
+                    }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@PatchPanda.Web/Services/DockerService.cs` around lines 290 - 291, The current
guard around existingContainer.OverrideGitHubRepo prevents copying
runningContainer.GitHubVersionRegex when a container is overridden, leaving
GitHubVersionRegex null and breaking VersionService and UpdateService flows;
modify the logic in DockerService.cs (around
existingContainer.OverrideGitHubRepo and GitHubVersionRegex handling) so that
you still do not overwrite when OverrideGitHubRepo is set, but if
existingContainer.GitHubVersionRegex is null then backfill it from
runningContainer.GitHubVersionRegex (i.e., only assign GitHubVersionRegex when
the target property is null), ensuring UpdateService and VersionService receive
a non-null regex while preserving override semantics.

@dkorecko dkorecko merged commit 7afcb22 into main Mar 27, 2026
6 checks passed
@dkorecko dkorecko deleted the fix/overriding-github-regex branch March 27, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant